{extend name="public/base" /}
{block name='content'}
{include file='public/content_header' /}
<!--数据列表页面-->
<section class="content">

    <!--顶部搜索筛选-->
    <div class="row">
        <div class="col-md-12">
            <div class="box">
                <div class="box-body">
                    <form class="form-inline searchForm" id="searchForm" action="{:url('index')}" method="GET">

                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$member_id ? $member_id : '' ;}"
                                   name="member_id" id="member_id" class="form-control input-sm"
                                   placeholder="申请人融云ID搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$x_member_id ? $x_member_id : '' ;}"
                                   name="x_member_id" id="x_member_id" class="form-control input-sm"
                                   placeholder="下级融云ID搜索">
                        </div>
                        <div class="form-group" style="padding-top: 3px;">
                            <select name="status" id="status" class="form-control input-sm index-search">
                                <option value="">-处理状态-</option>
                                <option value="0"{if isset($status) && $status=='0'}selected{/if}>待处理</option>
                                <option value="1"{if isset($status) && $status=='1'}selected{/if}>已同意</option>
                                <option value="2"{if isset($status) && $status=='2'}selected{/if}>已拒绝</option>
                            </select>
                        </div>

                        <div class="form-group" style="padding-top: 3px;">
                            <input value="{$add_time|default=''}" readonly name="add_time" id="add_time"
                                   class="form-control input-sm indexSearchDateRange" placeholder="申请时间搜索">
                        </div>
                        <script>
                            laydate.render({
                                elem: '#add_time',
                                range: true,
                            });
                        </script>

                        <div class="form-group" style="padding-top: 3px;">
                            <button class="btn btn-sm btn-primary" type="submit"><i class="fa fa-search"></i> 查询
                            </button>
                        </div>

                        <div class="form-group" style="padding-top: 3px;">
                            <button onclick="clearSearchForm()" class="btn btn-sm btn-default" type="button"><i
                                    class="fa  fa-eraser"></i> 清空查询
                            </button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <div class="row">
        <div class="col-md-12">
            <div class="box">

                <div class="box-body table-responsive">
                    <table class="table table-hover table-bordered datatable" width="100%">
                        <thead>
                        <tr style="white-space: nowrap">
                            <th style="text-align: center;vertical-align: middle;width: 10%">申请人融云ID</th>
                            <th style="text-align: center;vertical-align: middle;width: 15%">申请人用户信息</th>
                            <th style="text-align: center;vertical-align: middle;width: 10%">下级融云ID</th>
                            <th style="text-align: center;vertical-align: middle;width: 15%">下级用户信息</th>
                            <th style="text-align: center;vertical-align: middle;width: 15%">申请理由</th>
                            <th style="text-align: center;vertical-align: middle;width: 15%">图片</th>
                            <th style="text-align: center;vertical-align: middle;width: 10%">申请时间</th>
                            <th style="text-align: center;vertical-align: middle;width: 10%">处理状态</th>
                            <th style="text-align: center;vertical-align: middle;width: 15%">处理理由</th>
                            <th style="text-align: center;vertical-align: middle;width: 10%">处理时间</th>
                            <th style="text-align: center;vertical-align: middle;width: 10%">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {foreach name='data' id='item' key='data_key'}

                        <tr>
                            <td style="text-align: center;vertical-align: middle;">{$item.member_id}</td>
                            <td style="text-align: center;vertical-align: middle;">【手机号：{$item.s_me_phone}】【昵称：{$item.s_me_nick_name}】【性别：{$item.s_me_sex_word}】</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.x_member_id}</td>
                            <td style="text-align: center;vertical-align: middle;">【手机号：{$item.x_me_phone}】【昵称：{$item.x_me_nick_name}】【性别：{$item.x_me_sex_word}】</td>
                            <td style="text-align: center;vertical-align: middle;" title="{$item.content}">{$item.content_sl}</td>

                            {if $item.img_url_arr==''}
                            <td style="text-align: center;vertical-align: middle;">未上传</td>
                            {/if}
                            {if $item.img_url_arr!=''}
                            <td style="text-align: center;vertical-align: middle;" class="photo-list">
                                {foreach name='item.img_url_arr' id='items' key='data_keys'}
                                <img class="dataListImg" src="{$items}">
                                {/foreach}
                            </td>
                            {/if}
                            <td style="text-align: center;vertical-align: middle;">{$item.add_time}</td>

                            <td style="text-align: center;vertical-align: middle;">
                                {if $item.status==0}
                                <span style="color: blue">{$item.status_word}</span>
                                {/if}
                                {if $item.status==1}
                                <span style="color: green">{$item.status_word}</span>
                                {/if}
                                {if $item.status==2}
                                <span style="color: red">{$item.status_word}</span>
                                {/if}
                            </td>

                            <td style="text-align: center;vertical-align: middle;" title="{$item.cl_content}">{$item.cl_content_sl}</td>
                            <td style="text-align: center;vertical-align: middle;">{$item.cl_time}</td>


                            <td style="text-align: center;vertical-align: middle;">
                                {if $item.status==0}
                                    <a data-id="{$item.id}" data-url="passbang" data-width="65%" data-height="45%" data-confirm="2" data-type="2"
                                       class="btn btn-success btn-xs AjaxButton"  title="同意用户的绑定下级申请" data-toggle="tooltip">
                                        同意绑定
                                    </a>

                                    <a data-id="{$item.id}" data-url="refusebang" data-width="65%" data-height="45%" data-confirm="2" data-type="2"
                                       class="btn btn-danger btn-xs AjaxButton"  title="拒绝用户的绑定下级申请" data-toggle="tooltip">
                                        拒绝绑定
                                    </a>
                                {else/}
                                    -
                                {/if}
                            </td>
                        </tr>
                        {/foreach}
                        </tbody>
                    </table>
                </div>

                <!-- 数据列表底部 -->
                <div class="box-footer">
                    {$page|raw}
                    <label class="control-label pull-right" style="margin-right: 10px; font-weight: 100;">
                        <small>共{$total}条记录</small>&nbsp;
                        <small>每页显示</small>
                        &nbsp;
                        <select class="input-sm" onchange="changePerPage(this)">
                            <option value="10" {if $admin.per_page==10}selected{/if}>10</option>
                            <option value="20" {if $admin.per_page==20}selected{/if}>20</option>
                            <option value="30" {if $admin.per_page==30}selected{/if}>30</option>
                            <option value="50" {if $admin.per_page==50}selected{/if}>50</option>
                            <option value="100" {if $admin.per_page==100}selected{/if}>100</option>
                        </select>
                        &nbsp;
                        <small>条记录</small>
                    </label>
                </div>

            </div>
        </div>
    </div>
</section>
<script>
    $(function () {
        $('.photo-list img').on('click', function () {
            layer.photos({
                photos: '.photo-list',
                shadeClose: false,
                closeBtn: 2,
                anim: 5
            });
        })
    });

</script>
{/block}

